/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ez2find.model;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

/**
 *
 * @author Owner
 */
@NamedQueries(value={@NamedQuery(name="listAllImages", query="SELECT i FROM Image i" ),
                     @NamedQuery(name="lastImageCode", query="SELECT MAX(i.code) FROM Image i")})

@Entity
public class Image implements Serializable {

    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE)
    private long id;
    private long code;
    private String image;
    @ManyToOne()
    private Hous hous;
    @ManyToOne()
    private Sale sale;
    @ManyToOne()
    private Community community;
    @ManyToOne()
    private Personal personal;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public long getCode() {
        return code;
    }

    public void setCode(long code) {
        this.code = code;
    }

    public Hous getHous() {
        return hous;
    }

    public void setHous(Hous hous) {
        this.hous = hous;
    }

    public Sale getSale() {
        return sale;
    }

    public void setSale(Sale sale) {
        this.sale = sale;
    }

    public Community getCommunity() {
        return community;
    }

    public void setCommunity(Community community) {
        this.community = community;
    }

    public Personal getPersonal() {
        return personal;
    }

    public void setPersonal(Personal personal) {
        this.personal = personal;
    }
    
}
